package com.example.springbootvue.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.springbootvue.entity.Emp;
import com.example.springbootvue.dao.EmpMapper;
import com.example.springbootvue.service.IEmpService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.springbootvue.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yz
 * @since 2023-03-07
 */
@Service
public class EmpServiceImpl extends ServiceImpl<EmpMapper, Emp> implements IEmpService {
    @Autowired
    private EmpMapper empMapper;
    @Override
    public Result<IPage<Emp>> getAll(Integer currentPage, Integer pageSize) {
        Page<Emp> page = new Page<>(currentPage,pageSize);
        IPage<Emp> empPage =  empMapper.queryTest(page, null);
        return new Result<>(200,"查询成功",empPage);
    }
}
